@extends("admin.index")

@section("title","产品分类管理")

@section("css")
@endsection

@section("content")

    <div class="page-inner">
        <div class="page-header">
            <nav class="breadcrumb">
                <div class="left row">
                    <li class="breadcrumb-item"><a href="#">产品管理</a></li>
                    <li class="breadcrumb-item active" aria-current="page">产品创建</li>
                </div>
                <div class="right row">
                    <li class="breadcrumb-item"><i class="fa fa-reply"></i></li>
                    <li class="breadcrumb-item active" aria-current="page"><i class="fa fa-refresh"></i> </li>
                </div>
            </nav>
        </div>

        <div class="row">
            <div class="col-md-12 grid-margin stretch-card">
                <div class="card">
                    <div class="card-header">
                        <div class="card-title">
                            <a href="{{route("admin.category.index")}}" class="btn btn-primary btn-sm btn-border">产品分类列表</a>
                        </div>
                    </div>

                    <form class="forms-sample" action="{{route('admin.category.store')}}" method="post">
                        <div class="card-body">
                            @include("admin.common.result")
                            @include("admin.common.validate")
                            @csrf
                            <div class="form-group">
                                <label for="pid">上级分类</label>
                                <select name="pid" class="form-control">
                                    <option value="0">顶级分类</option>
                                    @foreach($cates as $item)
                                        <option value="{{$item->id}}">{{$item->level == 0 ? "" : "|"}}{{str_repeat("----",$item->level)}}{{$item->name}}</option>
                                    @endforeach
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="name">分类名称</label>
                                <input type="text" name="name" class="form-control" id="key" value="" placeholder="请输入分类名称">
                            </div>
                            <div class="form-group">
                                <label for="sort">排序</label>
                                <input type="text" name="sort" class="form-control" id="key" value="100" placeholder="请输入分类名称">
                            </div>
                        </div>

                        <div class="card-action">
                            <button class="btn btn-success" type="submit">Submit</button>
                            <button class="btn btn-danger">Cancel</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection
